//
//  SAlertView.h
//  SAlterView
//
//  Created by Samuel on 15/9/1.
//  Copyright (c) 2015年 Samuel. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol SAlertViewDelegate;
@interface SAlertView : UIView

@property (nonatomic, weak)NSObject<SAlertViewDelegate> *delegate;
/**
 *  默认SalterView
 *
 *  @param title               titleString
 *  @param message             messageString(默认最高300)
 *  @param delegate            代理
 *  @param cancelButtonTitle   取消
 *  @param confirmButtonTitles 确定
 *
 *  @return
 */
- (instancetype)initWithTitle:(NSString *)title
                      message:(NSString *)message
                     delegate:(id /*<UIAlertViewDelegate>*/)delegate
            cancelButtonTitle:(NSString *)cancelButtonTitle
          confirmButtonTitles:(NSString *)confirmButtonTitles;
/**
 *  自定义SAlterView
 *
 *  @param centerView    中间显示的View
 *  @param point         自定义位置(添加位移)
 *  @param delegate      代理
 *  @param cancelButtons 取消按钮
 *  @param ortherButton  其他按钮
 *
 *  @return
 */
- (instancetype)initWithView:(UIView *)centerView
                coustomPoint:(CGPoint)point
                    delegate:(id /*<UIAlertViewDelegate>*/)delegate
                cancelButton:(UIButton *)cancelButtons
                ortherButton:(UIButton *)ortherButton, ... NS_REQUIRES_NIL_TERMINATION;
/**
 *  自定义SAlterView
 *
 *  @param centerView    中间显示的View
 *  @param delegate      代理
 *  @param cancelButtons 取消按钮
 *  @param ortherButton  其他按钮
 *
 *  @return
 */
- (instancetype)initWithView:(UIView *)centerView
                    delegate:(id /*<UIAlertViewDelegate>*/)delegate
                cancelButton:(UIButton *)cancelButton
                ortherButton:(UIButton *)ortherButton, ... NS_REQUIRES_NIL_TERMINATION;
/**
 *  显示
 */
- (void)show;
/**
 *  关闭
 */
- (void)dismiss;
/**
 *  打开点击背景关闭功能
 */
@property (nonatomic, assign)BOOL openTapBackgroundToDismiss;
@end

@protocol SAlertViewDelegate <NSObject>

@required

@optional
- (void)sAlertView:(SAlertView *)sAlertView clickedButtonAtIndex:(NSInteger)buttonIndex;
@end



